#include"progressbar.h"
char label[5]="-/\\|";
char a[102]={0};
void progressbar1()
{
    int cnt=0;
    while(cnt<=100)
    {
        printf("[%-100s][%d%%][%c]\r",a,cnt,label[cnt%4]);
        fflush(stdout);
        a[cnt++]=BODY;
        a[cnt]=RIGHT;
        usleep(100000);
        
    }
    printf("\n");
}

void progressbar2(int rate)
{
    
    printf("[%-100s][%d%%][%c]\r",a,rate,label[rate%4]);
    fflush(stdout);
    a[rate++]=BODY;
    a[rate]=RIGHT;
    
}

